Many types of computer-based resources, including shared resources, are utilized with synchronization processes to ensure proper and efficient use of those resources. Such resources include, for example, storage devices, databases, and computer processors. Synchronization may need to occur, for example, when one or more processing threads concurrently need use of those resources. Often when multiple threads need use of a single resource or a resource that requires atomic access (e.g., a memory object) a synchronization object (e.g., a semaphore object) may be employed to manage use of the resource between the threads. Other resources can include, for example, linked lists, queues, or storage offsets (e.g., that require access serialization). For example, the synchronization object may place some threads in a waiting queue while allowing another thread to utilize the resource.
In certain circumstances, different processes trying to access the same resource carry different overall system priorities and/or importance. For example, a thread which is utilizing a storage device to store or retrieve critical or time sensitive data has a greater priority than a thread utilizing the storage device to clean up temporary files. In some cases, a lower priority thread may already have a lock on the resource and/or other lower priority threads may be ahead of higher priority threads in a resource waiting queue. In some cases, the higher priority threads may have to wait for the lower priority threads to finish processing before they can continue with their own processing, which may be detrimental to overall system performance.
For example, FIG. 1 shows a high priority thread 10 requesting a lock to a synchronization object at 15 which a low priority background thread 50 had previously acquired a lock to at 55. While the background thread 50 retains a lock to the synchronization object, the high priority thread 10 must wait in a waiting queue for a time period 20 for the background thread to release its lock at 60 before the high priority thread obtains a lock at 25.